package com.yx.test3d.model;

import android.content.Context;
import android.opengl.Matrix;

import com.yx.test3d.bean.Obj3D;
import com.yx.test3d.light.DirectLight;
import com.yx.test3d.program.ModelProgram;
import com.yx.test3d.utils.LogUtils;

import java.util.List;

public class ObjModel extends Model<Obj3D> {

    protected List<Obj3D> data;
    private ModelProgram modelProgram;

    public float[] shadowProjeMatrix = new float[16];
    public float[] shadowViewMatrix = new float[16];


    public ObjModel(List<Obj3D> obj3DList) {
        setData(obj3DList);
    }

    public List<Obj3D> getData() {
        return data;
    }

    /**
     * 设置/更新模型数据
     * 此方法必须在GLThread中执行
     *
     * @param modelData 模型数据
     */
    private void setData(List<Obj3D> modelData) {
        data = modelData;
    }

    /**
     * 销毁模型
     * 需在GLThread中执行
     */
    public void onDestroy() {
        modelProgram.destroy();
    }
}
